package com.ll.springai.commponent;

import java.util.function.Function;
import org.springframework.ai.embedding.EmbeddingModel;
import org.springframework.ai.vectorstore.SimpleVectorStore;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

@Configuration
public class AIConfig {
    @Bean
    @Description("某某地方天气怎么样")
    public Function<LocationWeatherFunction.Request, LocationWeatherFunction.Response> locationWeatherFunction() {
        return new LocationWeatherFunction();
    }

    @Bean
    @Description("某某可以参加面试吗")
    public Function<RecruitServiceFunction.Request, RecruitServiceFunction.Response> recruitServiceFunction() {
        return new RecruitServiceFunction();
    }

    @Bean
    public VectorStore createVectorStore(@Qualifier("ollamaEmbeddingModel") EmbeddingModel model) {
        return new SimpleVectorStore(model);
    }
}
